##
## Leader Login and Project name
##
##
LOGIN=chane-_s
PROJ=jdv

##
## Tar options and extension
##
##
EXT=tar.bz2
TAR_OPT=cvfj

##
## Rules
##
##
DIR=${LOGIN}-${PROJ}
TAR=${LOGIN}-${PROJ}.${EXT}
TAR_ARG=--exclude=.svn --exclude=${TAR}

all:
	./configure
	cd src; make

clean:
	cd src; make clean
	find . -name "*~" -exec rm -rf {} \;
	find . -name "*.o" -exec rm -rf {} \;
	find . -name "*.rules" -exec rm -rf {} \;

distclean: clean
	cd src; make distclean
	find . -name "*.tgz" -exec rm -rf {} \;
	find . -name "*.bz2" -exec rm -rf {} \;
	find . -name "*.log" -exec rm -rf {} \;
	find . -name "*.core" -exec rm -rf {} \;
	-rm -R doc/html doc/latex
	-rm -R ./${DIR} ./${TAR}

dist: distclean
	cd ../;							\
	tar ${TAR_OPT} ./${DIR}/${TAR} ${TAR_ARG} ${DIR};

doc:
	cd doc && doxygen doc.cfg
	echo -e "\033[32mPlease open : "`pwd`"/""doc/html/index.html\033[0m"

.PHONY: check clean distclean dist doc
